﻿using System;
using System.Xml.Linq;
using IcicleFramework.Components.Behaviors;

namespace IcicleFramework.GameServices
{
    public interface IBehaviorFactory : IGameService
    {
        /// <summary>
        /// Creates a new IBehavior using the information provided in the XElement.
        /// </summary>
        /// <param name="element">The XElement containing the information required for this IBehavior.</param>
        /// <returns>The requested IBehavior, or null if not IBehavior could be generated from the given XElement.</returns>
        IBehavior GenerateBehavior(XElement element);

        /// <summary>
        /// Creates a new <see cref="IBehavior"/> of Type type, with default/uninitialized values.
        /// </summary>
        /// <param name="type">The type of <see cref="IBehavior"/> to create.</param>
        /// <returns>The created <see cref="IBehavior"/> with default/uninitialized values, or null if no <see cref="IBehavior"/> matching the given type could be found.</returns>
        IBehavior GenerateBehavior(Type type);
    }
}
